<!DOCTYPE html>
<html lang="en"  xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>拦截记录</title>
    <link rel="stylesheet" th:href="@{/component/pear/css/pear.css}" />
</head>
<body class="pear-container">
<div class="layui-card">
    <div class="layui-card-body">
        <div class="layui-tab layui-tab-card">
            <ul class="layui-tab-title">
                <li class="layui-this">拦截记录</li>
            </ul>
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">
                    <table style="margin-top: 10px;" id="log-login-table" lay-filter="user-table"></table>
                </div>
            </div>
        </div>
    </div>
</div>
</body>



<script type="text/html" id="log-createTime">
    {{layui.util.toDateString(d.intercept_time,  "yyyy-MM-dd HH:mm:ss")}}
</script>


<script th:src="@{/component/layui/layui.js}"></script>
<script th:src="@{/component/pear/pear.js}"></script>
<script>
    layui.use(['table','form','jquery','element'],function () {
        let table = layui.table;
        let form = layui.form;
        let element = layui.element;

        let MODULE_PATH = "/system/logging/";

        let cols = [
            [
                {title: 'id', field: 'id', align:'center'},
                {title: '拦截ip', field: 'intercept_ip', align:'center'},
                {title: '所在地', field: 'intercept_address', align:'center'},
                {title: '浏览器', field: 'intercept_browser', align:'center'},
                {title: '操作系统', field: 'intercept_os', align:'center'},
                {title: '拦截时间', field: 'intercept_time',templet:'#log-createTime', align:'center'},
                {title: '描述', field: 'desc', align:'center'},
            ]
        ]


        table.render({
            elem: '#log-login-table',
            url: '/pear/interceptData',
            page: true ,
            cols: cols ,
            skin: 'line',
            toolbar: false
        });

        form.on('submit(dict-type-query)', function(data){
            table.reload('dict-type-table',{where:data.field})
            return false;
        });

        window.error = function(obj){
            layer.open({
                type: 1,
                title: '异常信息',
                shade: 0,
                area: ['450px', '350px'],
                content: '<div class="pear-container"><div class="layui-card"><div class="layui-card-body">'+obj.data['error']+'</div></div></div>'
            });
        }
    })
</script>
</html>